function save_variables(mouse_id,fname,vars)
var_dir='C:\Data\zmarpawe\var\';
if ~isdir([var_dir mouse_id])
    mkdir([var_dir], mouse_id);
end

if exist([var_dir mouse_id '\' fname '_vars.mat'],'file')
    choice=input(['there already is a file with this name. Replace [0,1]?: ']);
    if choice
        try
            save([var_dir mouse_id '\' fname '_vars'],'mouse_id','vars','-append','-v7.3');
        catch
            save([var_dir mouse_id '\' fname '_vars'],'mouse_id','vars','-v7.3');
        end
    end
else
    try
        save([var_dir mouse_id '\' fname '_vars'],'mouse_id','vars','-append','-v7.3');
    catch
        save([var_dir mouse_id '\' fname '_vars'],'mouse_id','vars','-v7.3');
    end
end